/**
 * @file wa_ll.h
 * 
 */

#ifndef _WA_LL_H
#define _WA_LL_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "wa_conf.h"
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

typedef uint8_t wa_ll_node;

typedef struct
{
    uint32_t n_size;
    wa_ll_node* head;
    wa_ll_node* tail;
}wa_ll;
/**********************
 * GLOBAL PROTOTYPES
 **********************/
 
void wa_ll_init(wa_ll * ll_p, uint32_t n_size);
void wa_ll_node_init(wa_ll_node* node_p);
void* wa_ll_add_head(wa_ll * ll_p);
void* wa_ll_add_tail(wa_ll * ll_p);
void * wa_ll_get_head(wa_ll * ll_p);
void * wa_ll_get_tail(wa_ll * ll_p);
void * wa_ll_get_prev(wa_ll * ll_p, void * n_act);
void * wa_ll_get_next(wa_ll * ll_p, void * n_act);
void wa_ll_remove(wa_ll  * ll_p, void * node_p);
void wa_ll_clear(wa_ll * ll_p);
void wa_ll_chg_list(wa_ll * ll_old_p, wa_ll * ll_new_p, void * node);

/**********************
 *      MACROS
 **********************/


#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
